import requests
import json

def get_ip():
    url = "http://httpbin.org/ip"  
    r = requests.get(url)  # 获取返回的值
    ip = json.loads(r.text)["origin"]  # 取其中某个字段的值
    print(ip)
    return ip

    